#!/bin/bash

#------------------------------------------------------------------------------
#Filename:	74810-bunzip2.sh
#Version:	1.1
#Date:	        2013/08/02
#Author:	yuanhui.shi
#Email:	        yuanhui.shi@cs2c.com.cn
#Summary:	02.01系统核心功能-06基础命令行工具-13bzip压缩工具-04bzip程序解压文件
#Notes:	        bunzip2命令解压缩文件
#Copyright:	China Standard Software Co.,Ltd.
#History:
#	        Version 1.0,2013/08/02
#	        -The first one
#	        Version 1.1,2013/09/09
#	        -Modify the script to satisfy the shell standard
#------------------------------------------------------------------------------


PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

source ../../lib/Echo.sh

function CleanData ()
{
  rm -rf test test1
  rm -rf log1

  EchoInfo "74810-bunzip2.sh执行完毕"
}

trap "CleanData" EXIT

echo "hello!" > test
cp test test1
bzip2 test
bunzip2 test.bz2
LANG=C ls -l test.bz2 &> log1

file test |grep 'ASCII text' && cat log1|grep 'cannot access test.bz2: No such file or directory' && diff test test1
EchoResult "bunzip 命令可用"


